(function(win, $){
    var setFormResult = win.setFormResult = function (data) {
        //console.log(data);
        layer.closeAll();
        if(data.status != 10000) {
            layer.alert(data.errmsg, {icon: 5});
        } else {
            layer.confirm('修改成功！', {icon: 6, title:'系统提示', btn: ['OK']}, function(index){
                location.reload(true);
            });
        }
    }
    $(function(){
        $('#form_update').on('valid.form', function(e, form){
            layer.load();
            var password=$("input[name='newPassword']").val();
            var password2=$("input[name='newPassword2']").val();
            if(password!=password2){
            	layer.closeAll();
            	layer.alert('两次密码不一致！', {icon: 5});
            	return;
            }
            form.submit();
        });
    });
})(window, jQuery);
